[Fusion] Add onError to source schema capabilities#9608
Merged
tobias-tengler merged 2 commits intomainfrom Apr 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an onError capability for source schemas and propagates it through configuration parsing into downstream subgraph requests (HTTP and in-memory connectors), alongside a broader rename of HTTP source schema client/configuration types.
Changes:
- Parse
capabilities.onErrorfrom source schema transport settings and store it on the source schema client configuration. - Forward configured
onErrorinto outgoing subgraph requests (HTTP transport and in-memory connector) and snapshot serialization. - Update/rename HTTP source schema client/configuration types and adjust tests/snapshots accordingly.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/FusionRequestExecutorManagerTests.cs | Updates assertions to the renamed HTTP configuration type. |
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Configuration/ParsersTests.cs | Removes the old combined parser tests (superseded by a dedicated test class). |
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Configuration/HttpSourceSchemaClientConfigurationParserTests.cs | Adds/extends parser test coverage including onError parsing behavior. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/SourceSchemaErrorTests.OnError_SchemaDefault_Null_AppliesWithoutPerRequestOverride.yaml | Aligns snapshot title with renamed test. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/SourceSchemaErrorTests.OnError_Null_OnSourceSchema_Forwards_To_Subgraph_Request.yaml | New snapshot validating onError is forwarded to subgraph requests. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/SourceSchemaErrorTests.cs | Renames a test and adds a new test verifying subgraph onError forwarding. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FusionTestBase.cs | Threads onError through gateway test setup options/config. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FusionTestBase.MatchSnapshot.cs | Writes onError into recorded request snapshots when present. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FusionTestBase.CreateSourceSchema.cs | Adds onError to source schema test server setup. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.resx | Renames HTTP client-related resource keys. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.Designer.cs | Regenerates designer to match renamed resource keys. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/ThrowHelper.cs | Updates resource lookups to renamed HTTP client resource keys. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/RequestCallbackState.cs | Updates callback state to reference renamed HTTP configuration type. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClientFactory.cs | Updates factory to use renamed HTTP client/config types. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClientConfiguration.cs | Adds OnError to HTTP configuration and renames the public configuration type. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClient.cs | Forwards config OnError into generated subgraph requests and renames the public client type. |
| src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/CoreFusionGatewayBuilderExtensions.SourceSchemaClients.cs | Adds onError to DI extension APIs and updates them to renamed configuration type. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Configuration/Parsers/HttpSourceSchemaClientConfigurationParser.cs | Parses capabilities.onError and sets it on the produced HTTP configuration. |
| src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemorySourceSchemaClientFactory.cs | Passes OnError from configuration into the in-memory client. |
| src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemorySourceSchemaClientConfiguration.cs | Adds OnError to the in-memory client configuration. |
| src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemorySourceSchemaClient.cs | Applies OnError via errorHandlingMode when building in-memory operation requests. |
Files not reviewed (1)
- src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.Designer.cs: Language not supported
Comments suppressed due to low confidence (3)
src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/CoreFusionGatewayBuilderExtensions.SourceSchemaClients.cs:67
AddHttpClientConfigurationis a public extension method, and inserting the new optionalonErrorparameter before the existing optional*AcceptHeaderValuesparameters is a source-breaking change for callers that used positional arguments. Consider keeping the old signature (or adding an overload) and addingonErrorat the end to preserve positional-call compatibility.
public static IFusionGatewayBuilder AddHttpClientConfiguration(
this IFusionGatewayBuilder builder,
string name,
Uri baseAddress,
SupportedOperationType supportedOperations = SupportedOperationType.All,
SourceSchemaClientCapabilities capabilities = SourceSchemaClientCapabilities.All,
ErrorHandlingMode? onError = null,
ImmutableArray<MediaTypeWithQualityHeaderValue>? defaultAcceptHeaderValues = null,
ImmutableArray<MediaTypeWithQualityHeaderValue>? batchingAcceptHeaderValues = null,
ImmutableArray<MediaTypeWithQualityHeaderValue>? subscriptionAcceptHeaderValues = null,
Action<OperationPlanContext, ExecutionNode, HttpRequestMessage>? onBeforeSend = null,
Action<OperationPlanContext, ExecutionNode, HttpResponseMessage>? onAfterReceive = null,
Action<OperationPlanContext, ExecutionNode, SourceSchemaResult>? onSourceSchemaResult = null)
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClientConfiguration.cs:12
- Renaming the public configuration type from
SourceSchemaHttpClientConfigurationtoHttpSourceSchemaClientConfigurationis a breaking change for any external consumers (and similarly for related APIs). If the rename is not intended to be breaking, consider keeping the old type name as an[Obsolete]shim (e.g., deriving from the new type or using type forwarding) to preserve compatibility.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClient.cs:22 - Renaming the public client type from
SourceSchemaHttpClienttoHttpSourceSchemaClientis a breaking change for consumers that referenced the old type directly. If backward compatibility is desired, consider providing an[Obsolete]wrapper/alias for the old name that forwards to the new implementation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.